package com.blb.common.feign;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.common.entity.Product;
import com.blb.common.util.ResponseResult;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * 降级处理类
 */
@Component
public class ProductServiceFeignClientFallback implements ProductServiceFeignClient {

    /**
     * 降级方法返回兜底数据
     * @param id
     * @return
     */
    @Override
    public ResponseResult<Product> getProductById(Long id) {
        Product product = new Product(id,"降级数据", BigDecimal.valueOf(0),"测试");
        return ResponseResult.ok(product);
    }

    @Override
    public ResponseResult<Product> getProductById2(Long id) {
        return null;
    }

    @Override
    public ResponseResult<String> saveProduct(Product product) {
        return null;
    }

    @Override
    public ResponseResult<String> updateProduct(Product product) {
        return null;
    }

    @Override
    public ResponseResult<String> updateProduct(Long id) {
        return null;
    }

    @Override
    public ResponseResult<Page<Product>> getProductPage(Long current) {
        return null;
    }
}
